<!DOCTYPE html>
<html lang="en">
  <head>
    <title>UIColor Extension Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
    <script src="../js/lunr.min.js" defer></script>
    <script src="../js/typeahead.jquery.js" defer></script>
    <script src="../js/jazzy.search.js" defer></script>
  </head>
  <body>
    <a name="//apple_ref/swift/Extension/UIColor" class="dashAnchor"></a>
    <a title="UIColor Extension Reference"></a>
    <header>
      <div class="content-wrapper">
        <p><a href="../index.html">LYConvenienceKitTest 1.0.0 Docs</a> (75% documented)</p>
        <div class="header-right">
          <form role="search" action="../search.json">
            <input type="text" placeholder="Search documentation" data-typeahead>
          </form>
        </div>
      </div>
    </header>
    <div class="content-wrapper">
      <p id="breadcrumbs">
        <a href="../index.html">LYConvenienceKitTest Reference</a>
        <img id="carat" src="../img/carat.png" alt=""/>
        UIColor Extension Reference
      </p>
    </div>
    <div class="content-wrapper">
      <nav class="sidebar">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a href="../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Extensions.html#/c:objc(cs)NSBundle">Bundle</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/Date.html">Date</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/Dictionary.html">Dictionary</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/Double.html">Double</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions.html#/c:objc(cs)NSMutableAttributedString">NSMutableAttributedString</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/String.html">String</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions.html#/c:objc(cs)UICollectionViewFlowLayout">UICollectionViewFlowLayout</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/UIColor.html">UIColor</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/UIColor/LYColorStyle.html">– LYColorStyle</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/UIColor/LYGradientColorDirection.html">– LYGradientColorDirection</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions.html#/c:objc(cs)UIImage">UIImage</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/UIView.html">UIView</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Functions.html">Functions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Functions.html#/s:20LYConvenienceKitTest8LYAppLog_8fileName06methodG010lineNumberyx_S2SSitlF">LYAppLog(_:fileName:methodName:lineNumber:)</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Protocols/LYBundleConvenience.html">LYBundleConvenience</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/LYCollectionViewFlowLayoutConvenience.html">LYCollectionViewFlowLayoutConvenience</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/LYImageConvenience.html">LYImageConvenience</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/LYMutableAttributedStringConvenience.html">LYMutableAttributedStringConvenience</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/LYViewConvenience.html">LYViewConvenience</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Structs.html">Structures</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Structs/LYDateConvenienceFunc.html">LYDateConvenienceFunc</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/LYDictionaryConvenienceFunc.html">LYDictionaryConvenienceFunc</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/LYDoubleConvenienceFunc.html">LYDoubleConvenienceFunc</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/LYMixtureAttribute.html">LYMixtureAttribute</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/LYScreenSize.html">LYScreenSize</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/LYStringConvenienceFunc.html">LYStringConvenienceFunc</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/LYViewConvenienceFunc.html">LYViewConvenienceFunc</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/LYViewConvenienceFunc/LYUIBorderSideType.html">– LYUIBorderSideType</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">
        <section>
          <section class="section">
            <h1>UIColor</h1>
              <div class="declaration">
                <div class="language">
                  
                  <pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">UIColor</span></code></pre>

                </div>
              </div>
            
          </section>
          <section class="section task-group-section">
            <div class="task-group">
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:So7UIColorC20LYConvenienceKitTestE12LYColorStyleO"></a>
                    <a name="//apple_ref/swift/Enum/LYColorStyle" class="dashAnchor"></a>
                    <a class="token" href="#/s:So7UIColorC20LYConvenienceKitTestE12LYColorStyleO">LYColorStyle</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Undocumented</p>

                        <a href="../Extensions/UIColor/LYColorStyle.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">LYColorStyle</span> <span class="p">:</span> <span class="kt">Int</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:So7UIColorC20LYConvenienceKitTestE_5alphaABSi_12CoreGraphics7CGFloatVtcfc"></a>
                    <a name="//apple_ref/swift/Method/init(_:alpha:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:So7UIColorC20LYConvenienceKitTestE_5alphaABSi_12CoreGraphics7CGFloatVtcfc">init(_:<wbr>alpha:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>16进制颜色，如：黑色  ly_rgb = 0x000000</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">convenience</span> <span class="nf">init</span><span class="p">(</span><span class="n">_</span> <span class="nv">ly_rgb</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">alpha</span><span class="p">:</span> <span class="kt">CGFloat</span> <span class="o">=</span> <span class="mi">1</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:So7UIColorC20LYConvenienceKitTestE_5alphaA2bCE12LYColorStyleO_12CoreGraphics7CGFloatVtcfc"></a>
                    <a name="//apple_ref/swift/Method/init(_:alpha:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:So7UIColorC20LYConvenienceKitTestE_5alphaA2bCE12LYColorStyleO_12CoreGraphics7CGFloatVtcfc">init(_:<wbr>alpha:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>设置颜色样式</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">convenience</span> <span class="nf">init</span><span class="p">(</span><span class="n">_</span> <span class="nv">ly_Style</span><span class="p">:</span> <span class="kt"><a href="../Extensions/UIColor/LYColorStyle.html">LYColorStyle</a></span><span class="p">,</span> <span class="nv">alpha</span><span class="p">:</span> <span class="kt">CGFloat</span> <span class="o">=</span> <span class="mi">1</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:So7UIColorC20LYConvenienceKitTestE14ly_randomColorABvpZ"></a>
                    <a name="//apple_ref/swift/Variable/ly_randomColor" class="dashAnchor"></a>
                    <a class="token" href="#/s:So7UIColorC20LYConvenienceKitTestE14ly_randomColorABvpZ">ly_randomColor</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>随机颜色</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="k">var</span> <span class="nv">ly_randomColor</span><span class="p">:</span> <span class="kt">UIColor</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:So7UIColorC20LYConvenienceKitTestE24LYGradientColorDirectionO"></a>
                    <a name="//apple_ref/swift/Enum/LYGradientColorDirection" class="dashAnchor"></a>
                    <a class="token" href="#/s:So7UIColorC20LYConvenienceKitTestE24LYGradientColorDirectionO">LYGradientColorDirection</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Undocumented</p>

                        <a href="../Extensions/UIColor/LYGradientColorDirection.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">LYGradientColorDirection</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:So7UIColorC20LYConvenienceKitTestE25ly_gradualImageFromColors6colors17gradientDirection0K4SizeSo7UIImageCSgSayABG_AbCE015LYGradientColorL0OSo6CGSizeVtFZ"></a>
                    <a name="//apple_ref/swift/Method/ly_gradualImageFromColors(colors:gradientDirection:gradientSize:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:So7UIColorC20LYConvenienceKitTestE25ly_gradualImageFromColors6colors17gradientDirection0K4SizeSo7UIImageCSgSayABG_AbCE015LYGradientColorL0OSo6CGSizeVtFZ">ly_gradualImageFromColors(colors:<wbr>gradientDirection:<wbr>gradientSize:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>颜色的渐变图片，默认方向从左到右</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kd">func</span> <span class="nf">ly_gradualImageFromColors</span><span class="p">(</span>
    <span class="nv">colors</span> <span class="p">:</span> <span class="p">[</span><span class="kt">UIColor</span><span class="p">],</span>
    <span class="nv">gradientDirection</span><span class="p">:</span><span class="kt"><a href="../Extensions/UIColor/LYGradientColorDirection.html">LYGradientColorDirection</a></span> <span class="o">=</span> <span class="o">.</span><span class="n">letfToRight</span><span class="p">,</span>
    <span class="nv">gradientSize</span><span class="p">:</span><span class="kt">CGSize</span> <span class="o">=</span> <span class="kt">CGSize</span><span class="p">(</span><span class="nv">width</span><span class="p">:</span> <span class="mi">300</span><span class="p">,</span> <span class="nv">height</span><span class="p">:</span> <span class="mi">120</span><span class="p">))</span> <span class="o">-&gt;</span> <span class="kt">UIImage</span><span class="p">?</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>colors</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>颜色的数组</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:So7UIColorC20LYConvenienceKitTestE8ly_imageSo7UIImageCyF"></a>
                    <a name="//apple_ref/swift/Method/ly_image()" class="dashAnchor"></a>
                    <a class="token" href="#/s:So7UIColorC20LYConvenienceKitTestE8ly_imageSo7UIImageCyF">ly_image()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>颜色转图片</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">ly_image</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">UIImage</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </section>
        </section>
        <section id="footer">
          <p>&copy; 2021 <a class="link" href="https://github.com/liuyik/LYConvenienceKit.git" target="_blank" rel="external noopener">liuyik</a>. All rights reserved. (Last updated: 2021-11-18)</p>
          <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
        </section>
      </article>
    </div>
  </body>
</html>
